# Contributor: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
# Maintainer: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
pkgname=keepassxc-browser
pkgver=1.8.9
pkgrel=0
pkgdesc="KeePassXC Browser Extension"
url="https://github.com/keepassxreboot/keepassxc-browser/"
arch="noarch"
license="GPL-3.0-or-later"
makedepends="npm"
source="keepassxc-browser-$pkgver.tar.gz::https://github.com/keepassxreboot/keepassxc-browser/archive/refs/tags/$pkgver.tar.gz"
options="!check net" # no tests, build fetches assets

prepare() {
	default_prepare
	npm ci
}

build() {
	# fetching translations requires a user account (and unmet dependencies).
	npm run build -- --skip-translations
}

package() {
	install -Dm644 keepassxc-browser_1.8.9_firefox.zip "$pkgdir/usr/lib/firefox/browser/extensions/keepassxc-browser@keepassxc.org.xpi"
}

sha512sums="
15d19c6bd03fc338d9deee1aabf2e81dd1709b515d48b0e051e5891fefb9350af4a1616d1f7e1d1c8e91c78244b44abe0ce44abd993d4c2c8f8c40c987e9bd78  keepassxc-browser-1.8.9.tar.gz
"
